<div class="st-cp-pg-home">
     

    <div id="ctn_inicial" class="conteudo st-cp-pg-inicial">
    <?php 
    $link = '';
    $imgs = '';
    $posicao = '68';
    //$g_img = glob('public/media/images/banner*.*');
    //foreach($g_img as $key => $img){
    foreach($this->fullbanner as $key => $banner){
        $img = glob('public/upload/fullbanner/'.$banner['BAN_ID'].'.*');
        @$img = $img[0];
        $style = '';
        $class = '';

        if($key > 0) $style = 'display: none;';
        if($key == 0) $class = 'class="action"';

        $alink .= '<a '.$class.' id="lnkb'.$key.'" itemref="bimg'.$key.'" itemid="'.$key.'" href="javascript:void(0)"></a>';
        //if(file_exists($this->urlbase.'/'.str_replace('.','_sld.',$img)))
            //$imgs .= '<img ALT="banner'.$key.'" id="bimg'.$key.'" src="'.$this->urlbase.'/'.str_replace('.','_sld.',$img).'" style="margin-left: '.$posicao.'px" >';
        $posicao += 34; 
    
         if(strlen($banner['BAN_LNK']) > 0) echo '<a href="'.$banner['BAN_LNK'].'" class="go_pag">';
    ?>
            <?php /* <a href="<?php echo $banner['BAN_LNK'];?>" class="g_pagina go_pag" pagina="<?php echo str_replace('#', '', $banner['BAN_LNK']);?>"> */ ?>
                <div id="banner<?php echo $key; ?>" class="banner" style="background-image: url('<?php echo $this->urlbase.'/'.$img; ?>');<?php echo $style; ?>"></div>
            <?php /* </a> */ ?>
        <?php 
            if(strlen($banner['BAN_LNK']) > 0) echo '</a>';
        } ?>
        <?php /* <a href="javascript:void(0)" class="seta lft" ><</a> */ ?>
        <?php /* <a href="javascript:void(0)" class="seta drt">></a> */ ?>
        <div class="lnkitg">
            <div class="imgs"><?php echo $imgs; ?></div>
            <?php echo $alink; ?>
        </div>
    </div>
    
<?php foreach($this->paginasite as $pag) {
    
    $class =  $pag['PGS_PAGREF'];
    if(strlen($pag['PGS_PAGPRI']) > 0) $class = strtolower($pag['PGS_PAGPRI']);
    
    if(strlen($pag['PGS_PAGEST']) == 0 && strlen($pag['PGS_TXT']) > 10){     
?>
    <div id="ctn_<?php echo $pag['PGS_PAGREF']?>" class="conteudo st-cp-pg-<?php echo $class; ?>">
        <div class="tl"><span><?php echo $pag['PGS_NOM']?></span></div>
        <?php 
        if(strlen($pag['PGS_PAGPRI']) > 0){
            
            $subpag = $this->db->fetchAll('SELECT SQL_CACHE * FROM PAGINA_SITE WHERE PGS_PAGPRI like "'.$pag['PGS_PAGPRI'].'" AND PGS_STA = 1 ORDER BY PGS_ORD ASC');
                
        ?>
        <div class="cp_content_txt">
            <div class="col_des">
                <ul class="cp_ctn_menu"> 
                    <?php foreach($subpag as $sub) { 
                        $action =  $pag['PGS_PAGREF'] == $sub['PGS_PAGREF'] ? 'action':''; 
                    ?>
                        <li>&rarrtl; <a href="#<?php echo $sub['PGS_PAGREF']; ?>" class="go_pag <?php echo $action; ?>"><?php echo $sub['PGS_NOMMEN']; ?></a></li>
                    <?php } ?>
                </ul>
            </div>

            <div class="col_txt">
        <?php } ?>
    
            <?php echo $pag['PGS_TXT']?>    
        
        <?php  if(strlen($pag['PGS_PAGPRI']) > 0){  ?>
            </div>
        </div>
        <?php } ?>     
                
    </div>
<?php } else{ 
    
switch($pag['PGS_PAGEST']) { // paginas criadas
    case 'contato': ?>  
    <div id="ctn_<?php echo $pag['PGS_PAGREF']?>" class="conteudo st-cp-pg-<?php echo $class; ?>">
        <div class="tl"><span><?php echo $pag['PGS_NOM']?></span></div>
        <div class="contato">
            <div id="mapa"></div>
            <div class="ct_form">
                <div class="ct_content">
                    <div class="endereco">
                        <a href="<?php $this->urlbase?>"><img ALT="Templo Guerreiros da Luz" src="<?php $this->urlbase?>public/media/images/logo_rodape.png" /></a>
                        <ul class="redes">
                            <?php if(strlen($this->parametros['PAR_FAC']) > 5){ ?>
                            <li><a href="http://<?php echo $this->parametros['PAR_FAC']; ?>" target="_blank"><img ALT="facebook" src="<?php $this->urlbase?>public/media/images/ic_facebook.png" /></a></li>
                            <?php } ?>
                            <?php if(strlen($this->parametros['PAR_TWI']) > 5){ ?>
                            <li><a href="http://<?php echo $this->parametros['PAR_TWI']; ?>" target="_blank"><img ALT="twitter" src="<?php $this->urlbase?>public/media/images/ic_twitter.png" /></a></li>
                            <?php } ?>
                        </ul>
                        <div class="end"><?php echo str_replace('#','<br/>',$this->parametros['PAR_END']); ?> <span class="tel"><?php echo  str_replace(array('54'),array('<span class="pre">54</span>'),$this->parametros['PAR_TEL']); ?></span></div>
                    </div>
                    <div class="formulario">
                        <form id="form_contato" method="post">
                            <input type="text" name="nome" placeholder="nome" value="" required="">
                            <input type="text" name="email" class="email" placeholder="e-mail" value="" required="">
                            <input type="text" name="assunto" placeholder="assunto" value="" required="">
                            <textarea rows="3" name="mensagem" required=""></textarea>
                            <button type="submit" name="enviar" class="g_pagina" pagina="form_contato">enviar</button>
                        </form>
                    </div>
                    
                    <div class="guapoweb">
                        © 2014 Caminhos de Aram Kaá. Todos os direitos reservados. Desenvolvido por <a href="//www.guapoweb.com.br" target="_blank">Guapo Web</a>.            
                    </div>
                    
                </div>
                
            </div>
        </div>
    </div>
<?php
    break;
} // switch
?>
    
<?php } // else
} // foreeach
?>
    
</div>

